import java.util.*;
class Fenshu{
    int _fz;
    int _fm;
    public Fenshu(int fz, int fm)
    {
        _fz = fz;
        _fm = fm;
    }
    public Fenshu add(Fenshu other)
    {
        int resultFm = _fm * other._fm;
        int resultFz = _fz * other._fm + _fm * other._fz;
        Fenshu result = new Fenshu(resultFz,resultFm);
        return result;
    }

    public Fenshu sub(Fenshu other)
    {
        int resultFm = _fm * other._fm;
        int resultFz = _fz * other._fm - _fm * other._fz;
        Fenshu result = new Fenshu(resultFz, resultFm);
        return result;
    }
    public int den(int a, int b)
    {
        int m = a;
        int n = b;
        int r = m;
        while (r != 0)
        {
            m = n;
            n = r;
            r = m % n;
        }
        return n;
    }

    public String toString()
    {
        String ret = "";
        if (_fz % _fm == 0)
        {
            ret+=_fz/_fm;
        }
        else
        {
            if(_fz*_fm<0)
                ret+="-";
            int a = Math.abs(_fz);
            int b = Math.abs(_fm);
            int s = den(a, b);
            a = a / s;
            b = b / s;
            ret+=(a+"/"+b);
        }
        return ret;
    }
}
public class Main4 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a,b,c,d;

        while(sc.hasNext()) {
            String s = sc.nextLine();
            a = (int)s.charAt(0) - '0';
            b = (int)s.charAt(2) - '0';
            c = (int)s.charAt(4) - '0';
            d = (int)s.charAt(6) - '0';

            char way = s.charAt(3);

            Fenshu first = new Fenshu(a,b);
            Fenshu second = new Fenshu(c,d);
            if(way=='+') {
                Fenshu result = first.add(second);
                System.out.println(result);
            }
            else {
                Fenshu result = first.sub(second);
                System.out.println(result);
            }
        }

        sc.close();
    }
}
